//package nancal.mp.mvc.devops
//
//import nancal.mp.nexus.NexusTask
//
//import nbcp.base.annotation.*
//import nbcp.base.annotation.mvc.*
//import org.springframework.web.bind.annotation.RequestMapping
//import org.springframework.web.bind.annotation.RequestMethod
//import org.springframework.web.bind.annotation.RestController
//import java.time.Duration
//import java.time.LocalDateTime
//
//@RequestMapping("/ops/nexus-task")
//@RestController
//@AdminSysOpsAction
//class NexusTaskController {
//
//    @RequestMapping("/exec", method = arrayOf(RequestMethod.GET, RequestMethod.POST))
//    fun exec(): String {
//        NexusTask.execTask();
//
//        return "同步任务在${Duration.between(LocalDateTime.now(), NexusTask.taskLastExecAt.plusMinutes(1)).toMinutes()}分钟内执行"
//    }
//
//    @RequestMapping("/status", method = arrayOf(RequestMethod.GET, RequestMethod.POST))
//    fun status(): String {
//        if (NexusTask.working) {
//            return "同步任务在运行中."
//        }
//
//        return "同步任务在${Duration.between(LocalDateTime.now(), NexusTask.taskLastExecAt.plusMinutes(1)).toMinutes()}分钟内执行"
//    }
//}